{% extends "school/layout.html" %}

{% set page_title = translate('首页') %}

{% block css %}
{% endblock %}

{% block content %}
    <style>
        .inform_more{
            display: block;
            float: right;
            margin-top: -24px;
            color: #fff;
        }
        .inform_more:hover{
            color:#fff;
        }
        .modal-body {
            text-align: left;
        }
        .modal-dialog {
            position: relative;
            width: 33%;
            margin-top: 8%;
        }
        .modal-dialog .modal-footer {
            text-align: center;
        }
    </style>

    <div class="m-scontent m-index">
    <h3 class="title">{{translate('感谢您选择 The ONE')}}</h3>

    <div class="wrap">
        <div class="rect first">
            <div class="sub-title">{{translate('与 The ONE 共同成长')}}</div>
            {% if block_contents[0].count() > 3 %}
            <a href="{{ url_for('school.block_list', bid=1) }}" class="inform_more">{{translate('更多')}}</a>
            {% endif %}
            <ul>
                {% for block_content in block_contents[0] %}
                {% if loop.index < 4 %}
                <li>
                    <a href="{{ block_content.url}}" {% if not block_content.read_status %} style="color:red" {% endif %} target="_blank">
                        {{ block_content.title }}
                    </a>
                </li>
                {% endif %}
                {% endfor %}
            </ul>
        </div>
        <div class="rect second">
            <div class="sub-title">{{translate('The ONE智能钢琴教室资料库')}}</div>
            {% if block_contents[1].count() > 3 %}
            <a href="{{ url_for('school.block_list', bid=2) }}" class="inform_more">{{translate('更多')}}</a>
            {% endif %}
            <ul>
                {% for block_content in block_contents[1] %}
                {% if loop.index < 4 %}
                <li>
                    <a href="{{ block_content.url}}" target="_blank">
                        {{ block_content.title }}
                    </a>
                </li>
                {% endif %}
                {% endfor %}
            </ul>
        </div>
    </div>
    {#
    <div class="wrap">
        <div class="rect first">
            <div class="sub-title">{{translate('常见问题')}}</div>
            {% if block_contents[2].count() == 3 %}
            <a href="{{ url_for('school.block_list', bid=3) }}" class="inform_more">{{translate('更多')}}</a>
            {% endif %}
            <ul>
                {% for block_content in block_contents[2] %}
                <li>
                    <a href="{{ block_content.url}}" target="_blank">
                        {{ block_content.title }}
                    </a>
                </li>
                {% endfor %}
            </ul>
        </div>
        <div class="rect second">
            <div class="sub-title">{{translate('教学示范与支持')}}</div>
            {% if block_contents[3].count() == 3 %}
            <a href="{{ url_for('school.block_list', bid=4) }}" class="inform_more">{{translate('更多')}}</a>
            {% endif %}
            <ul>
                {% for block_content in block_contents[3] %}
                <li>
                    <a href="{{ block_content.url}}" target="_blank">
                        {{ block_content.title }}
                    </a>
                </li>
                {% endfor %}
            </ul>
        </div>
    </div>
    #}
</div>

    <div class="modal fade" id="mymodal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
{#                <div class="modal-header"><button class="close" type="button" data-dismiss="modal">×</button>#}
{#                <button style="margin:5px 5px 0 0" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>#}
{#                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>#}
                <h4 class="modal-title">申请The ONE经销店</h4>
            </div>
            <div class="modal-body">
                <p>{{ authentication_info |safe }}</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success" onclick="location.href='{{ url_for('school.get_real_name_auth') }}'">立即认证</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">稍后提示</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
{% endblock %}


{% block js%}
    <script>
        $(function(){
            {% if authentication_info %}
                $("#mymodal").modal("toggle");
            {% endif %}

            $('.btn-primary').bind('click',function() {
                $("#mymodal").modal("toggle");
            });
        });
    </script>
{% endblock %}
